<template>
    <div class="home-container">
        <h3>欢迎来到首页</h3>
        <a href="#" @click.prevent="gotMovie(3)">跳转到电影3</a>
    </div>
</template>

<script setup>
    import { useRoute } from 'vue-router';
    const route = useRoute()
    const gotMovie = movieId => {
        route.push({
            name: 'MovieDetails',
            params: {id: movieId}
        })
    }
</script>

<style scoped>
   .home-container {
    min-height: 150px;
    background-color: #f2f2f2;
    padding: 15px;
   }
</style>